import request from '@/utils/request'
import { ParamArr } from '../../public/js/paramarr'

// 获取消息
export function getWebJsonMessage(data) {
  return request({
    dmName: 'THttpDM',
    lpName: 'GetWebJsonMessage',
    vPar: data
  })
}
// 注册消息
export function regWebJsonMessage(data) {
  return request({
    dmName: 'THttpDM',
    lpName: 'RegWebJsonMessage',
    vPar: data
  })
}
// web通用导入接口
export function webInsFunc(vPar) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebInsFunc',
    vPar: vPar
  })
}

// webInsFunc
export function webInsFunc1(vPar, fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebInsFunc',
    vPar: vPar,
    upload: true,
    fileObj
  })
}

// 获取模板数据
export function webUploadFlow(fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadFlow',
    upload: true,
    fileObj: fileObj,
    vPar: new ParamArr()
  })
}

// web通用导出接口
export function webOutFunc(data) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebOutFunc',
    vPar: data
  })
}

// 导入组件
export function webUploadComponent(data, fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadComponent',
    upload: true,
    vPar: data,
    fileObj
  })
}

// 导入用户
export function webUploadUser(data, fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadUser',
    upload: true,
    vPar: data,
    fileObj
  })
}

// 模板管理选择文件
export function webUploadFile(data, fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadFile',
    vPar: data,
    fileObj
  })
}

export function webAddMouleFile(data) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebAddMouleFile',
    vPar: data
  })
}
export function writeFile(data) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WriteFile',
    vPar: data
  })
}

// 导入
export function webUploadModleInPut(data, fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadModleInPut',
    vPar: data,
    upload: true,
    fileObj
  })
}

// 导入方案
export function webUploadPlan(data, fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadPlan',
    upload: true,
    vPar: data,
    fileObj
  })
}

// 导入告警策略
export function webUploadLevel(fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadLevel',
    upload: true,
    vPar: new ParamArr(),
    fileObj
  })
}

// 导入采集策略
export function webUploadTime(fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadTime',
    upload: true,
    vPar: new ParamArr(),
    fileObj
  })
}

// 导入机器参数
export function webUploadAgent(fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadAgent',
    upload: true,
    vPar: new ParamArr(),
    fileObj
  })
}

export function webUploadPower(vPar, fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadPower',
    upload: true,
    vPar,
    fileObj
  })
}

// 导出文本
export function webOutParamTxt(data) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebOutParamTxt',
    vPar: data
  })
}

// 导入参数
export function webUploadParam(fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadParam',
    upload: true,
    vPar: new ParamArr(),
    fileObj
  })
}

// 导入文本
export function readFile(fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'ReadFile',
    upload: true,
    vPar: new ParamArr(),
    fileObj
  })
}

// 导入流程任务
export function webUploadFlowTask(fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadFlowTask',
    upload: true,
    vPar: new ParamArr(),
    fileObj
  })
}

// 导入敏捷任务
export function webUploadBatchTask(fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadBatchTask',
    upload: true,
    vPar: new ParamArr(),
    fileObj
  })
}

// 上传文件通用接口
export function webUploadRPAFile(vPar, fileObj) {
  return request({
    dmName: 'THttpDM',
    lpName: 'WebUploadRPAFile',
    upload: true,
    vPar,
    fileObj
  })
}
